import { MeetingEntity } from '@/api/manager/meeting'
import { MtEntity } from '@/api/manager/mt'
export interface ICometdMccSubSmcuMt {
	mts: MtEntity[]
	cascade: MeetingEntity
}
/**
 * 转换后数据不保证
 * 因为后台推送消息等 会议和终端 是混用的，
 * 只能前台手动转换数据，通过mtType或者其他字段判断是否是会议
 *
 */
export function transEntityMtToMeeting(mt: MtEntity, parentId: string): MeetingEntity {
	return {
		id: mt.mt_key.replace(/_/g, '.'), //不一定对
		mt_key: mt.mt_key,
		parent_id: parentId,
		conf_level: mt.conf_level,
		cascade_id: mt.mt_id, //不一定对
		name: mt.name,
		conf_id: mt.e164,
		index: mt.index,
		online: mt.online ? 1 : 0,
		silence: mt.silence ? 1 : 0,
		mute: mt.mute ? 1 : 0,
		doubleflow: mt.doubleflow ? 1 : 0,
		up_mt: mt.up_mt ? 1 : 0,
		tvwall: mt.tvwall ? 1 : 0,
		vmp: mt.vmp ? 1 : 0,
		speaker: mt.speaker ? 1 : 0,
		ip: mt.mt_ip,
	}
}
export function isExistMtEntity(mt: Partial<MtEntity>): mt is MtEntity {
	return mt && mt.name !== undefined && mt.account !== undefined && mt.account_type !== undefined
}
